package com.netstar.property;

import java.io.IOException;

import org.json.JSONException;

public abstract class FloatProperty extends PrimitiveProperty {
	public abstract void set(Property obj, float val);

	public abstract float get(Property obj);

	public FloatProperty() {
	}

	@Override
	public void copy(Property lhs, Property rhs) {
		set(lhs, get(rhs));
	}

	@Override
	public void parse(Property obj, Object value) throws JSONException,
			IOException {
		if (value == null) {
			set(obj, 0);
		} else {
			set(obj, Float.parseFloat(value.toString()));
		}
	}

}
